/*
 * EntityManager.h
 *
 *  Created on: Nov 7, 2013
 *      Author: ruben
 */

#ifndef ENTITYMANAGER_H_
#define ENTITYMANAGER_H_
#include "UserManager.h"
#include "ConsultationManager.h"
#include "CategoryManager.h"
#include "QuoteRequestManager.h"
#include "ServiceManager.h"

class EntityManager {
private:
	UserManager *userManager;
	ConsultationManager *consultationManager;
	CategoryManager *categoryManager;
	QuoteRequestManager *quoteRequestManager;
	ServiceManager *serviceManager;
public:
	EntityManager();
	virtual ~EntityManager();
	int loginUser(char *name, char *pass);
	int lookingForUserIdentifier(int identifier, char *pass);
	int lookingForUserByIdentifier(int identifier, char *pass, int type);
	int createUser(int dni,char *name, char *lastName, char *email, char *password, char *province, char type);
	int modifyUser(int identifier, int newDNI,char *name, char *lastName, char *email, char *password, char *province);
	int eliminarUsuario(int identifier);
	//provider
	int changeUserToProvider(int identifier);
	int createService(int providerIdentifier,char *name, char *decription, char *type);
	int lookingForServiceByIdentifier(int identifier);
	int deleteServiceByIdentifier(int identifier);

	//consulting
	int lookingForConsultingByIdentifier(int identifier);
	int updateConsultingWith(int consultingID, char *answer);
	int changeUserToAdministrator(int identifier);
	int deleteUserAdministrator(int identifier);
	//category
	int createCategory(char *name, char *category);
	int createCategoryByFile(char *filePath);
	int lookingForCategory(int *identifier);
	int modifyCategory(int identifier, char *name, char *description);
	int deleteCategory(int identifier);
	int hideConsulting(int identifier);
	int recoverPasswordUserByIdentier(int userIdentifier, char *pass);

	//consultaing
	int createConsulting(int userID, int serviceID, char *consulting);
};

#endif /* ENTITYMANAGER_H_ */
